//
//  CYDialTool.h
//  CreditAddressBook
//
//  Created by Lee on 15/5/27.
//  Copyright (c) 2015年 Lee. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CYPerson.h"
@class CYCallHistory;
@class CYDeal;

typedef enum {
    CYTimeStyleDay = 2>>1,
    CYTimeStyleWeek,
    CYTimeStyleMonth,
    CYTimeStyleYear
}CYTimeStyle;

@interface CYDialTool : NSObject

//获取所收藏信息
@property (nonatomic,strong,readonly)NSArray *collectedDeals;
//额外属性
@property (nonatomic,assign) BOOL collected;

/**
 *  随机ID
 *
 *  @return
 */
+ (NSString *)randomID;

/**
 *  固定范围内的随机数
 *
 *  @return
 */
+ (int)randomNumForm:(int)from to:(int)to;

/**
 *  通话时长
 *
 *  @param time
 *
 *  @return 返回HH时mm分ss秒格式的时长
 */
+ (NSString *)callTime:(NSTimeInterval)time;

/**
 *  通话时长
 *
 *  @param time
 *
 *  @return 返回HH:mm:ss格式的时长
 */
+ (NSString *)callTime1:(NSTimeInterval)time;

/**
 *  获取今天，本周，本月的时间
 *
 *  @param style
 *
 *  @return
 */
+ (NSNumber *)timeWithStyle:(NSInteger)style;

/**
 *  将view转化为image
 */
+ (UIImage *)imageFromView:(UIView *)theView;

/**
 *  获得某个范围内的屏幕图像
 */
+ (UIImage *)imageFromView: (UIView *) theView atFrame:(CGRect)r;

/**
 *  拼音转ASCII
 */
+ (NSString *)pinyinToASCII:(NSString *)py;

/**
 *  建立拨号键盘搜索索引
 */
+ (NSString *)indexOfpinyin:(NSString *)py;
@end
